﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace WindowsGame1
{
    public class HUD
    {
        /// <summary>
        /// textura que representara a vida do jogador na fase
        /// </summary>
        public Texture2D texturaVida;

        Rectangle recTextura;
        Rectangle recCorte;

        /// <summary>
        /// inteiro que representara a pontuacao do jogador na fase
        /// </summary>
        static public int pontuacao;

        /// <summary>
        /// 
        /// </summary>
        public int quantidadeVida = 5;
 

        public HUD( Texture2D texturaVida)
        {
            this.texturaVida = texturaVida;
            recTextura = new Rectangle(0, 0, 200, 41);
            recCorte = new Rectangle(0, 0, 200, 41);
        }

        public void Update(GameTime gameTimme)
        {
            switch(quantidadeVida)
            {
                case 5:
                    recCorte.X = 0;
                    break;

                case 4:
                    recCorte.X = 40;
                    break;

                case 3:
                    recCorte.X = 80;
                    break;

                case 2:
                    recCorte.X = 120;
                    break;

                case 1:
                    recCorte.X = 160;
                    break;

            }
           
        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(texturaVida, recTextura,recCorte, Color.White);
            
        }
    }
}
